﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UsersEdit.aspx.cs" Inherits="PPAP.Web.Master.UsersEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript">

        function emailtouser() {
            var username = document.getElementById("txtUserName");
            var email = document.getElementById("txtEmail");
            username.value = email.value;
        }

        function check() {
            var testitem = document.getElementById("txtFamilyname");
            var remark = document.getElementById("txtFirstname");
            var username = document.getElementById("txtUserName");
            var email = document.getElementById("txtEmail");
            if (testitem.value == "") {
                alert("Family name is null");
                testitem.focus();
                return false;
            }
            if (remark.value == "") {
                alert("First name is null");
                remark.focus();
                return false;
            }
            if (email.value == "") {
                alert("Email is null");
                email.focus();
                return false;
            }
            username.value = email.value;
            if (username.value == "") {
                alert("UserName is null");
                username.focus();
                return false;
            }

            var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
            if (!myreg.test(email.value)) {
                alert('Email format error！');
                return false;
            }
            return confirm('Are you sure you want to save?');
        }
    </script>
    <style type="text/css">
        .style1
        {
            height: 23px;
        }
        td{ height:28px;}
    </style>
</head>
<body style="font-family: Arial, Helvetica, sans-serif; overflow-x: hidden;" bgcolor="#E7E8E8">
    <form id="form1" runat="server">
    <div>
        <table align="center" width="100%" style="margin-top: 10px;">
            <tr>
                <td style="width: 16%">
                    Family name
                </td>
                <td style="width: 34%">
                    <asp:TextBox autocomplete="off"   ID="txtFamilyname" runat="server" Width="260px"></asp:TextBox><font color='red'>*(please input family name)</font>
                </td>
                <td style="width: 16%">
                    First name
                </td>
                <td style="width: 34%">
                    <asp:TextBox autocomplete="off"   ID="txtFirstname" runat="server" Width="260px"></asp:TextBox><font color='red'>*(please input first name)</font>
                </td>
            </tr>
            <tr>
                <td>
                    Email
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtEmail" runat="server" OnTextChanged="txtEmail_TextChanged" 
                        Width="260px"></asp:TextBox>
                    <font color='red'>*(please input email)</font>
                </td>
                <td>
                    User name
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtUserName" runat="server" Enabled="False" Width="260px"></asp:TextBox><font color='red'>*(please input username)</font>
                    
                </td>
            </tr>
            <tr>
                <td>
                    Telephone
                </td>
                <td >
                    <asp:TextBox autocomplete="off"   ID="txtMobilephone" runat="server" Width="260px"></asp:TextBox>
                </td>
                <td>
                    Department
                </td>
                <td>
                    <asp:DropDownList ID="ddlDepartment" runat="server" Width="265px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Position
                </td>
                <td class="style1">
                    <asp:DropDownList ID="ddlPosition" runat="server" Width="265px" 
                        onselectedindexchanged="ddlPosition_SelectedIndexChanged" 
                        AutoPostBack="True">
                    </asp:DropDownList>
                </td>
                <td class="style1">
                    <asp:Label ID="lbSuperior" runat="server" Text="Superior "></asp:Label>
                </td>
                <td class="style1">
                    <asp:DropDownList ID="ddlUser" runat="server" Width="265px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr runat="server" id="truser">
            <td>Superior
                (China)</td><td>
                    <asp:DropDownList ID="ddlUser1" runat="server" Width="265px">
                    </asp:DropDownList>
                </td><td>Superior(Germany)
                </td><td>
                    <asp:DropDownList ID="ddlUser2" runat="server" Width="265px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Country
                </td>
                <td>
                    <asp:DropDownList ID="ddlCountry" runat="server" Width="265px">
                        <asp:ListItem>China</asp:ListItem>
                        <asp:ListItem>Germany</asp:ListItem>
                        <asp:ListItem>other</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    Postal code
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtSort" runat="server" Width="260px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Fax
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtFax" runat="server" Width="260px"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr runat="server" id="tr">
                <td>
                    Execute inspection task？
                </td>
                <td>
                    <asp:RadioButton ID="rbtY" runat="server" GroupName="s" Text="Yes" AutoPostBack="True"
                        OnCheckedChanged="rbtY_CheckedChanged" />
                    &nbsp;
                    <asp:RadioButton ID="rbtN" runat="server" GroupName="s" Text="No" AutoPostBack="True"
                        Checked="True" OnCheckedChanged="rbtY_CheckedChanged" />
                </td>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Test Department" Visible="False"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="DropDownList1" runat="server" Visible="False" 
                        Width="265px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr runat="server" id="trde">
                <td colspan="4">
                    <br />
                    Please select test department:
                    <asp:CheckBoxList ID="cbDe" runat="server" RepeatColumns="5" RepeatDirection="Horizontal">
                    </asp:CheckBoxList>
                    <br />
                </td>
            </tr>
            <tr>
                <td colspan="4" align="center">
                    <asp:Button ID="Button1" CssClass="button" runat="server" Text="Add" OnClick="Button1_Click"
                        OnClientClick="return check();" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
